Labels: text | diagram | screenshot | font OCR: GIF Encoder Init encoder by Bob Montgomery 1-21-88 Get color Notes: parent = color Get 1st color Parent is 1st color 1. son is child[parent] 2. bro(ther) is sib[person] person = son or bro 3. nvc = next valid code Get color 4. Init encoder: son = child[parent] All children = 0 Does parent have a son? All sib(lings) = 0 Codesize = bits/pixel + 1 son Y Clear code = 1 << bits/pixel Is son right color? End code = clear code + 1 min code = end code + 1 Create one max code = clear code << 1 child[parent] = nvc Shade[son] N E color shade[nvc] = color putcode[parent] bro = son Makes loop easier parent = color nvc = nvc + 1 Does brother have a brother? sib[bron N Make new VY Get him parent bro = sib[bro] Change codesize parent = son Is he right color? if required Shade[brot> NE color2 Create one Try other sib[bro] = nvc brothers Y Make new shade[nvc] = color parent putcode[parent] parent = bro parent = color nvc = nvc + 1